package com.atguigu.gulimall.product.service;

import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.SkuInfoEntity;
import com.atguigu.gulimall.product.vo.SkuItemVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * sku信息
 *
 * @author gyhe10
 * @email gyhe10@163.com
 * @date 2024-08-17 10:17:20
 */
public interface SkuInfoService extends IService<SkuInfoEntity> {

    PageUtils queryPageByCondition(Map<String, Object> params);

    List<SkuInfoEntity> getSkusBySpuId(Long spuId);

    /**
     * 根据 skuId 查询商品详情页需要展示的数据
     * @param skuId
     * @return
     */
    SkuItemVo item(Long skuId) throws ExecutionException, InterruptedException;

    /**
     * 根据 skuIdList 批量查询商品价格
     * @param skuIdList
     * @return
     */
    Map<Long, BigDecimal> getSkuPricesBySkuIdList(List<Long> skuIdList);
}

